Optimal. Leaf size=138 \[ -\frac{B \log \left (\cot (c+d x)-\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{2 \sqrt{2} d}+\frac{B \log \left (\cot (c+d x)+\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{2 \sqrt{2} d}+\frac{B \tan ^{-1}\left (1-\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} d}-\frac{B \tan ^{-1}\left (\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{\sqrt{2} d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0966662, antiderivative size = 138, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 9, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {21, 3476, 329, 297, 1162, 617, 204, 1165, 628} \[ -\frac{B \log \left (\cot (c+d x)-\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{2 \sqrt{2} d}+\frac{B \log \left (\cot (c+d x)+\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{2 \sqrt{2} d}+\frac{B \tan ^{-1}\left (1-\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} d}-\frac{B \tan ^{-1}\left (\sqrt{2} \sqrt{\cot (c+d x)}+1\right )}{\sqrt{2} d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 3476
Rule 329
Rule 297
Rule 1162
Rule 617
Rule 204
Rule 1165
Rule 628
Rubi steps
\begin{align*} \int \frac{\sqrt{\cot (c+d x)} (a B+b B \tan (c+d x))}{a+b \tan (c+d x)} \, dx &=B \int \sqrt{\cot (c+d x)} \, dx\\ &=-\frac{B \operatorname{Subst}\left (\int \frac{\sqrt{x}}{1+x^2} \, dx,x,\cot (c+d x)\right )}{d}\\ &=-\frac{(2 B) \operatorname{Subst}\left (\int \frac{x^2}{1+x^4} \, dx,x,\sqrt{\cot (c+d x)}\right )}{d}\\ &=\frac{B \operatorname{Subst}\left (\int \frac{1-x^2}{1+x^4} \, dx,x,\sqrt{\cot (c+d x)}\right )}{d}-\frac{B \operatorname{Subst}\left (\int \frac{1+x^2}{1+x^4} \, dx,x,\sqrt{\cot (c+d x)}\right )}{d}\\ &=-\frac{B \operatorname{Subst}\left (\int \frac{1}{1-\sqrt{2} x+x^2} \, dx,x,\sqrt{\cot (c+d x)}\right )}{2 d}-\frac{B \operatorname{Subst}\left (\int \frac{1}{1+\sqrt{2} x+x^2} \, dx,x,\sqrt{\cot (c+d x)}\right )}{2 d}-\frac{B \operatorname{Subst}\left (\int \frac{\sqrt{2}+2 x}{-1-\sqrt{2} x-x^2} \, dx,x,\sqrt{\cot (c+d x)}\right )}{2 \sqrt{2} d}-\frac{B \operatorname{Subst}\left (\int \frac{\sqrt{2}-2 x}{-1+\sqrt{2} x-x^2} \, dx,x,\sqrt{\cot (c+d x)}\right )}{2 \sqrt{2} d}\\ &=-\frac{B \log \left (1-\sqrt{2} \sqrt{\cot (c+d x)}+\cot (c+d x)\right )}{2 \sqrt{2} d}+\frac{B \log \left (1+\sqrt{2} \sqrt{\cot (c+d x)}+\cot (c+d x)\right )}{2 \sqrt{2} d}-\frac{B \operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1-\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} d}+\frac{B \operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1+\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} d}\\ &=\frac{B \tan ^{-1}\left (1-\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} d}-\frac{B \tan ^{-1}\left (1+\sqrt{2} \sqrt{\cot (c+d x)}\right )}{\sqrt{2} d}-\frac{B \log \left (1-\sqrt{2} \sqrt{\cot (c+d x)}+\cot (c+d x)\right )}{2 \sqrt{2} d}+\frac{B \log \left (1+\sqrt{2} \sqrt{\cot (c+d x)}+\cot (c+d x)\right )}{2 \sqrt{2} d}\\ \end{align*}
Mathematica [C] time = 0.0214403, size = 36, normalized size = 0.26 \[ -\frac{2 B \cot ^{\frac{3}{2}}(c+d x) \text{Hypergeometric2F1}\left (\frac{3}{4},1,\frac{7}{4},-\cot ^2(c+d x)\right )}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.21, size = 324, normalized size = 2.4 \begin{align*} -{\frac{B\sqrt{2} \left ( \cos \left ( dx+c \right ) -1 \right ) \left ( \cos \left ( dx+c \right ) +1 \right ) ^{2}}{2\,d \left ( \sin \left ( dx+c \right ) \right ) ^{2}\cos \left ( dx+c \right ) }\sqrt{{\frac{\cos \left ( dx+c \right ) }{\sin \left ( dx+c \right ) }}}\sqrt{-{\frac{\cos \left ( dx+c \right ) -1-\sin \left ( dx+c \right ) }{\sin \left ( dx+c \right ) }}}\sqrt{{\frac{\cos \left ( dx+c \right ) -1+\sin \left ( dx+c \right ) }{\sin \left ( dx+c \right ) }}}\sqrt{{\frac{\cos \left ( dx+c \right ) -1}{\sin \left ( dx+c \right ) }}} \left ( i{\it EllipticPi} \left ( \sqrt{-{\frac{\cos \left ( dx+c \right ) -1-\sin \left ( dx+c \right ) }{\sin \left ( dx+c \right ) }}},{\frac{1}{2}}-{\frac{i}{2}},{\frac{\sqrt{2}}{2}} \right ) -i{\it EllipticPi} \left ( \sqrt{-{\frac{\cos \left ( dx+c \right ) -1-\sin \left ( dx+c \right ) }{\sin \left ( dx+c \right ) }}},{\frac{1}{2}}+{\frac{i}{2}},{\frac{\sqrt{2}}{2}} \right ) -2\,{\it EllipticF} \left ( \sqrt{-{\frac{\cos \left ( dx+c \right ) -1-\sin \left ( dx+c \right ) }{\sin \left ( dx+c \right ) }}},1/2\,\sqrt{2} \right ) +{\it EllipticPi} \left ( \sqrt{-{\frac{\cos \left ( dx+c \right ) -1-\sin \left ( dx+c \right ) }{\sin \left ( dx+c \right ) }}},{\frac{1}{2}}-{\frac{i}{2}},{\frac{\sqrt{2}}{2}} \right ) +{\it EllipticPi} \left ( \sqrt{-{\frac{\cos \left ( dx+c \right ) -1-\sin \left ( dx+c \right ) }{\sin \left ( dx+c \right ) }}},{\frac{1}{2}}+{\frac{i}{2}},{\frac{\sqrt{2}}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.46595, size = 153, normalized size = 1.11 \begin{align*} -\frac{{\left (2 \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (\sqrt{2} + \frac{2}{\sqrt{\tan \left (d x + c\right )}}\right )}\right ) + 2 \, \sqrt{2} \arctan \left (-\frac{1}{2} \, \sqrt{2}{\left (\sqrt{2} - \frac{2}{\sqrt{\tan \left (d x + c\right )}}\right )}\right ) - \sqrt{2} \log \left (\frac{\sqrt{2}}{\sqrt{\tan \left (d x + c\right )}} + \frac{1}{\tan \left (d x + c\right )} + 1\right ) + \sqrt{2} \log \left (-\frac{\sqrt{2}}{\sqrt{\tan \left (d x + c\right )}} + \frac{1}{\tan \left (d x + c\right )} + 1\right )\right )} B}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} B \int \sqrt{\cot{\left (c + d x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B b \tan \left (d x + c\right ) + B a\right )} \sqrt{\cot \left (d x + c\right )}}{b \tan \left (d x + c\right ) + a}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]